package com.jalarbee.core.generic.dao;

import java.io.Serializable;
import java.util.List;

import com.jalarbee.core.util.Chunk;

public interface GenericDao <T, PK extends Serializable> {

    /** Persist the newInstance object into database */
    public void create(T newInstance) throws DataAcessException;

    /** Retrieve an object that was previously persisted to the database using
     *   the indicated id as primary key
     */
    public T read(PK id) throws DataAcessException;

    /** Save changes made to a persistent object.  */
    public void update(T transientObject) throws DataAcessException;

    /** Remove an object from persistent storage in the database */
    public void delete(T persistentObject) throws DataAcessException;

    /** Retrieve all persisted instances of this class */
    public List<T> findAll(Chunk chunk) throws DataAcessException;

}